<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <!--管理员登陆的第一个界面-->
    <base th:href="@{/}">
    <meta charset="UTF-8">
    <title>统计分析</title>
    <link rel="stylesheet" href="css/bootstrap.min.css"/>
    <!--    ==-->
    <script th:src="@{/jin/echarts.min.js}" type="text/javascript"></script>
    <script th:src="@{/jin/jquery.min.js}" type="text/javascript"></script>
    <!--    ==-->
    <script th:inline="javascript">
        var user = [[${user}]];
        var order = [[${order}]];
        var goods = [[${goods}]];
        var type = [[${type}]];
    </script>
</head>
<body>
    <!-- 加载header.html -->
    <div th:include="admin/header"></div>
    <br><br><br>
    <section class="home-section">
        <div class="home-content">
            <i class='bx bx-menu'></i>
            <span class="text">管理员界面</span>
        </div>
        <div class="test">
            <!--<div class="container">
                 <div class="panel panel-primary">
                     <div class="panel-heading">
                         <h3 class="panel-title">统计分析</h3>
                     </div>
                     <div class="panel-body">
                         <div class="table table-responsive">
                             <table class="table table-striped">
                                 <tbody class="text-center">
                                 <tr>
                                     <th style="text-align: center">用户数量</th>
                                     <th style="text-align: center">订单数量</th>
                                     <th style="text-align: center">商品数量</th>
                                     <th style="text-align: center">类型数量</th>
                                 </tr>
                                 <tr>
                                     <td th:text="${user}"></td>
                                     <td th:text="${order}"></td>
                                     <td th:text="${goods}"></td>
                                     <td th:text="${type}"></td>

                                 </tr>
                                      </tbody>
                             </table>
                         </div>
                     </div>
                 </div>
             </div>-->
            <div id="main" style="width: 600px;height:400px; display: inline-block"></div>
            <script type="text/javascript">
                // 基于准备好的dom，初始化echarts实例
                var myChart = echarts.init(document.getElementById('main'));

                option = {
                    backgroundColor: '#2c343c',

                    title: {
                        text: 'Customized Pie',
                        left: 'center',
                        top: 20,
                        textStyle: {
                            color: '#ccc'
                        }
                    },

                    tooltip: {
                        trigger: 'item'
                    },

                    visualMap: {
                        show: false,
                        min: 80,
                        max: 600,
                        inRange: {
                            colorLightness: [0, 1]
                        }
                    },
                    series: [
                        {
                            name: '访问来源',
                            type: 'pie',
                            radius: '55%',
                            center: ['50%', '50%'],
                            data: [
                                {value: user, name: '用户数量'},
                                {value: order, name: '订单数量'},
                                {value: goods, name: '商品数量'},
                                {value: type, name: '类型数量'},
                            ].sort(function (a, b) {
                                return a.value - b.value;
                            }),
                            roseType: 'radius',
                            label: {
                                color: 'rgba(255, 255, 255, 0.3)'
                            },
                            labelLine: {
                                lineStyle: {
                                    color: 'rgba(255, 255, 255, 0.3)'
                                },
                                smooth: 0.2,
                                length: 10,
                                length2: 20
                            },
                            itemStyle: {
                                color: '#c23531',
                                shadowBlur: 200,
                                shadowColor: 'rgba(0, 0, 0, 0.5)'
                            },

                            animationType: 'scale',
                            animationEasing: 'elasticOut',
                            animationDelay: function (idx) {
                                return Math.random() * 200;
                            }
                        }
                    ]
                };

                // 使用刚指定的配置项和数据显示图表。
                myChart.setOption(option);
            </script>

            <div id="main1" style="width: 600px;height:400px;display: inline-block"></div>
            <script type="text/javascript">
                // 基于准备好的dom，初始化echarts实例
                var myChart = echarts.init(document.getElementById('main1'));

                option = {
                    backgroundColor: '#2c343c',
                    xAxis: {
                        type: 'category',
                        data: ['用户数量', '订单数量', '商品数量', '类型数量']
                    },
                    yAxis: {
                        type: 'value'
                    },
                    series: [{
                        data: [user, order, goods, type],
                        type: 'bar',
                        showBackground: true,
                        backgroundStyle: {
                            color: 'rgba(180, 180, 180, 0.2)'
                        }
                    }]
                };
                // 使用刚指定的配置项和数据显示图表。
                myChart.setOption(option);
            </script>
            <div class="container">
                <div class="panel panel-primary">
                    <div class="panel-heading" style="background-color: rgba(85,81,133,0.6);">
                        <h3 class="panel-title">统计分析</h3>
                    </div>
                    <div class="panel-body">
                        <div class="table table-responsive">
                            <table class="table table-striped">
                                <tbody class="text-center">
                                <tr>
                                    <th style="text-align: center">用户数量</th>
                                    <th style="text-align: center">订单数量</th>
                                    <th style="text-align: center">商品数量</th>
                                    <th style="text-align: center">类型数量</th>
                                </tr>
                                <tr>
                                    <td th:text="${user}"></td>
                                    <td th:text="${order}"></td>
                                    <td th:text="${goods}"></td>
                                    <td th:text="${type}"></td>

                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </section>


    <!--===============-->


</body>
</html>
